.class Lcom/nemustech/tiffany/world/TFRenderer;
.super Ljava/lang/Object;
.source "TFRenderer.java"

# interfaces
.implements Lcom/nemustech/tiffany/world/TFView$Renderer;


# static fields
.field private static final FRAME_RATE_EVAL_PERIOD:I = 0xbb8

.field private static final TAG:Ljava/lang/String; = "TFRenderer"

.field private static final TICK_HOLD_LIMIT:J = 0x1eL

.field private static accumulatedDrawingCount:J

.field static isDrawLoop:Z

.field static mGL:Ljavax/microedition/khronos/opengles/GL10;

.field private static mScratch:[F


# instance fields
.field private mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

.field private mCamera:Lcom/nemustech/tiffany/world/TFCamera;

.field private mCancelSelection:Z

.field private mCurrTick:J

.field private mDownTick:J

.field private mDownX:F

.field private mDownY:F

.field private mDragInterval:J

.field private mDrawCount:I

.field private mEndX:F

.field private mEndY:F

.field private mFPSTick:J

.field mHeight:I

.field private mHitTestLine:[F

.field private mHoldStartX:F

.field private mHoldStartY:F

.field private final mLayer:Ljava/util/LinkedList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/LinkedList",
            "<",
            "Lcom/nemustech/tiffany/world/TFWorld$Layer;",
            ">;"
        }
    .end annotation
.end field

.field mLeft:I

.field private mMVP:[F

.field private mPrevDragTick:J

.field private mPrevTick:J

.field private mRecentSelectedFaceIndex:I

.field private mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

.field mSelectListener:Lcom/nemustech/tiffany/world/TFWorld$OnSelectListener;

.field private mStartX:F

.field private mStartY:F

.field private mTickPassed:F

.field mTop:I

.field private mUnViewportBuffer:[F

.field private mUpX:F

.field private mUpY:F

.field private mV:[F

.field private mValidDown:Z

.field mWidth:I

.field private mWorld:Lcom/nemustech/tiffany/world/TFWorld;


# direct methods
.method static constructor <clinit>()V
    .locals 2

    .prologue
    .line 33
    const/4 v0, 0x0

    sput-boolean v0, Lcom/nemustech/tiffany/world/TFRenderer;->isDrawLoop:Z

    .line 945
    const/16 v0, 0x8

    new-array v0, v0, [F

    sput-object v0, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    .line 985
    const-wide/16 v0, 0x0

    sput-wide v0, Lcom/nemustech/tiffany/world/TFRenderer;->accumulatedDrawingCount:J

    return-void
.end method

.method public constructor <init>(Lcom/nemustech/tiffany/world/TFWorld;Lcom/nemustech/tiffany/world/TFCamera;)V
    .locals 2
    .parameter "world"
    .parameter "camera"

    .prologue
    const/4 v1, 0x0

    const/4 v0, 0x0

    .line 18
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 933
    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownX:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownY:F

    .line 934
    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUpX:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUpY:F

    .line 935
    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartX:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartY:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mEndX:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mEndY:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mTickPassed:F

    .line 938
    const/16 v0, 0x8

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHitTestLine:[F

    .line 939
    const/16 v0, 0x20

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUnViewportBuffer:[F

    .line 982
    const/4 v0, 0x0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDrawCount:I

    .line 20
    iput-object p1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    .line 21
    iput-object p2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mCamera:Lcom/nemustech/tiffany/world/TFCamera;

    .line 22
    sput-object v1, Lcom/nemustech/tiffany/world/TFRenderer;->mGL:Ljavax/microedition/khronos/opengles/GL10;

    .line 24
    new-instance v0, Ljava/util/LinkedList;

    invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    .line 26
    iput-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    .line 27
    const/4 v0, -0x1

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedFaceIndex:I

    .line 29
    const/16 v0, 0x10

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mMVP:[F

    .line 30
    const/4 v0, 0x4

    new-array v0, v0, [F

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mV:[F

    .line 31
    return-void
.end method

.method private computeMVP([FI)V
    .locals 7
    .parameter "modelView"
    .parameter "modelViewOffset"

    .prologue
    const/4 v1, 0x0

    .line 827
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v0}, Lcom/nemustech/tiffany/world/TFWorld;->getCamera()Lcom/nemustech/tiffany/world/TFCamera;

    move-result-object v6

    .line 828
    .local v6, camera:Lcom/nemustech/tiffany/world/TFCamera;
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mMVP:[F

    iget-object v2, v6, Lcom/nemustech/tiffany/world/TFCamera;->mMatrix:[F

    move v3, v1

    move-object v4, p1

    move v5, v1

    invoke-static/range {v0 .. v5}, Landroid/opengl/Matrix;->multiplyMM([FI[FI[FI)V

    .line 829
    return-void
.end method

.method private findSelectedModel(Lcom/nemustech/tiffany/world/TFObject;FFF[F)Lcom/nemustech/tiffany/world/TFModel;
    .locals 18
    .parameter "object"
    .parameter "x"
    .parameter "y"
    .parameter "nearest"
    .parameter "near"

    .prologue
    .line 530
    const/16 v16, 0x0

    .line 532
    .local v16, selectedModel:Lcom/nemustech/tiffany/world/TFModel;
    move-object/from16 v0, p1

    instance-of v0, v0, Lcom/nemustech/tiffany/world/TFHolder;

    move v5, v0

    if-eqz v5, :cond_3

    .line 533
    move-object/from16 v0, p1

    check-cast v0, Lcom/nemustech/tiffany/world/TFHolder;

    move-object v12, v0

    .line 534
    .local v12, holder:Lcom/nemustech/tiffany/world/TFHolder;
    invoke-virtual {v12}, Lcom/nemustech/tiffany/world/TFHolder;->isVisible()Z

    move-result v5

    if-eqz v5, :cond_0

    invoke-virtual {v12}, Lcom/nemustech/tiffany/world/TFHolder;->isDrawable()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 537
    invoke-virtual {v12}, Lcom/nemustech/tiffany/world/TFHolder;->getSlotCount()I

    move-result v15

    .line 538
    .local v15, objectCount:I
    const/4 v5, 0x1

    sub-int v13, v15, v5

    .local v13, i:I
    :goto_0
    if-ltz v13, :cond_0

    .line 539
    iget-object v5, v12, Lcom/nemustech/tiffany/world/TFHolder;->mDrawOrder:Landroid/util/SparseIntArray;

    if-nez v5, :cond_1

    move v5, v13

    :goto_1
    invoke-virtual {v12, v5}, Lcom/nemustech/tiffany/world/TFHolder;->getObjectInSlot(I)Lcom/nemustech/tiffany/world/TFObject;

    move-result-object v6

    move-object/from16 v5, p0

    move/from16 v7, p2

    move/from16 v8, p3

    move/from16 v9, p4

    move-object/from16 v10, p5

    invoke-direct/range {v5 .. v10}, Lcom/nemustech/tiffany/world/TFRenderer;->findSelectedModel(Lcom/nemustech/tiffany/world/TFObject;FFF[F)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v17

    .line 543
    .local v17, temp:Lcom/nemustech/tiffany/world/TFModel;
    if-eqz v17, :cond_2

    .line 544
    move-object/from16 v16, v17

    .end local v12           #holder:Lcom/nemustech/tiffany/world/TFHolder;
    .end local v13           #i:I
    .end local v15           #objectCount:I
    .end local v17           #temp:Lcom/nemustech/tiffany/world/TFModel;
    :cond_0
    :goto_2
    move-object/from16 v5, v16

    .line 563
    :goto_3
    return-object v5

    .line 539
    .restart local v12       #holder:Lcom/nemustech/tiffany/world/TFHolder;
    .restart local v13       #i:I
    .restart local v15       #objectCount:I
    :cond_1
    iget-object v5, v12, Lcom/nemustech/tiffany/world/TFHolder;->mDrawOrder:Landroid/util/SparseIntArray;

    invoke-virtual {v5, v13}, Landroid/util/SparseIntArray;->get(I)I

    move-result v5

    goto :goto_1

    .line 538
    .restart local v17       #temp:Lcom/nemustech/tiffany/world/TFModel;
    :cond_2
    add-int/lit8 v13, v13, -0x1

    goto :goto_0

    .line 549
    .end local v12           #holder:Lcom/nemustech/tiffany/world/TFHolder;
    .end local v13           #i:I
    .end local v15           #objectCount:I
    .end local v17           #temp:Lcom/nemustech/tiffany/world/TFModel;
    :cond_3
    move-object/from16 v0, p1

    instance-of v0, v0, Lcom/nemustech/tiffany/world/TFModel;

    move v5, v0

    if-eqz v5, :cond_0

    .line 550
    move-object/from16 v0, p1

    check-cast v0, Lcom/nemustech/tiffany/world/TFModel;

    move-object v14, v0

    .line 551
    .local v14, model:Lcom/nemustech/tiffany/world/TFModel;
    invoke-virtual {v14}, Lcom/nemustech/tiffany/world/TFModel;->isVisible()Z

    move-result v5

    if-eqz v5, :cond_0

    invoke-virtual {v14}, Lcom/nemustech/tiffany/world/TFModel;->isDrawable()Z

    move-result v5

    if-eqz v5, :cond_0

    invoke-virtual {v14}, Lcom/nemustech/tiffany/world/TFModel;->isTouchable()Z

    move-result v5

    if-eqz v5, :cond_0

    .line 553
    move-object/from16 v0, p0

    move-object v1, v14

    move/from16 v2, p2

    move/from16 v3, p3

    move-object/from16 v4, p5

    invoke-virtual {v0, v1, v2, v3, v4}, Lcom/nemustech/tiffany/world/TFRenderer;->getSelectedFaceIndex(Lcom/nemustech/tiffany/world/TFModel;FF[F)I

    move-result v11

    .line 554
    .local v11, faceIndex:I
    if-gez v11, :cond_4

    .line 555
    const/4 v5, 0x0

    goto :goto_3

    .line 556
    :cond_4
    const/4 v5, 0x0

    aget v5, p5, v5

    cmpl-float v5, v5, p4

    if-lez v5, :cond_0

    .line 557
    const/4 v5, 0x0

    aget p4, p5, v5

    .line 558
    iput v11, v14, Lcom/nemustech/tiffany/world/TFModel;->mHitFace:I

    .line 559
    move-object/from16 v16, v14

    goto :goto_2
.end method

.method private getMatrix(Ljavax/microedition/khronos/opengles/GL10;I[F)V
    .locals 3
    .parameter "gl"
    .parameter "mode"
    .parameter "mat"

    .prologue
    .line 821
    move-object v0, p1

    check-cast v0, Lcom/nemustech/tiffany/world/TFGL;

    move-object v1, v0

    .line 822
    .local v1, gl2:Lcom/nemustech/tiffany/world/TFGL;
    invoke-virtual {v1, p2}, Lcom/nemustech/tiffany/world/TFGL;->glMatrixMode(I)V

    .line 823
    const/4 v2, 0x0

    invoke-virtual {v1, p3, v2}, Lcom/nemustech/tiffany/world/TFGL;->getMatrix([FI)V

    .line 824
    return-void
.end method

.method private getSquare([FIIFF)F
    .locals 6
    .parameter "vertex"
    .parameter "offset"
    .parameter "blobSize"
    .parameter "x"
    .parameter "y"

    .prologue
    .line 457
    const/4 v3, 0x0

    .line 458
    .local v3, sumPositive:F
    const/4 v2, 0x0

    .line 462
    .local v2, sumNegative:F
    move v1, p2

    .local v1, i:I
    :goto_0
    add-int v4, p2, p3

    const/4 v5, 0x2

    sub-int/2addr v4, v5

    if-ge v1, v4, :cond_0

    .line 465
    aget v4, p1, v1

    add-int/lit8 v5, v1, 0x3

    aget v5, p1, v5

    mul-float/2addr v4, v5

    add-float/2addr v3, v4

    .line 466
    add-int/lit8 v4, v1, 0x1

    aget v4, p1, v4

    add-int/lit8 v5, v1, 0x2

    aget v5, p1, v5

    mul-float/2addr v4, v5

    add-float/2addr v2, v4

    .line 462
    add-int/lit8 v1, v1, 0x2

    goto :goto_0

    .line 472
    :cond_0
    aget v4, p1, v1

    mul-float/2addr v4, p5

    add-int/lit8 v5, p2, 0x1

    aget v5, p1, v5

    mul-float/2addr v5, p4

    add-float/2addr v4, v5

    add-float/2addr v3, v4

    .line 473
    add-int/lit8 v4, v1, 0x1

    aget v4, p1, v4

    mul-float/2addr v4, p4

    aget v5, p1, p2

    mul-float/2addr v5, p5

    add-float/2addr v4, v5

    add-float/2addr v2, v4

    .line 478
    sub-float v4, v3, v2

    invoke-static {v4}, Ljava/lang/Math;->abs(F)F

    move-result v4

    const/high16 v5, 0x4000

    div-float v0, v4, v5

    .line 479
    .local v0, S:F
    return v0
.end method

.method private project([FI[FI)V
    .locals 9
    .parameter "obj"
    .parameter "objOffset"
    .parameter "win"
    .parameter "winOffset"

    .prologue
    const/4 v1, 0x0

    const/high16 v8, 0x3f00

    const/high16 v7, 0x3f80

    .line 837
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mV:[F

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mMVP:[F

    move v3, v1

    move-object v4, p1

    move v5, p2

    invoke-static/range {v0 .. v5}, Landroid/opengl/Matrix;->multiplyMV([FI[FI[FI)V

    .line 839
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mV:[F

    const/4 v2, 0x3

    aget v0, v0, v2

    div-float v6, v7, v0

    .line 841
    .local v6, rw:F
    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLeft:I

    int-to-float v0, v0

    iget v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWidth:I

    int-to-float v2, v2

    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mV:[F

    aget v1, v3, v1

    mul-float/2addr v1, v6

    add-float/2addr v1, v7

    mul-float/2addr v1, v2

    mul-float/2addr v1, v8

    add-float/2addr v0, v1

    aput v0, p3, p4

    .line 842
    add-int/lit8 v0, p4, 0x1

    iget v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mTop:I

    int-to-float v1, v1

    iget v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHeight:I

    int-to-float v2, v2

    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mV:[F

    const/4 v4, 0x1

    aget v3, v3, v4

    mul-float/2addr v3, v6

    add-float/2addr v3, v7

    mul-float/2addr v2, v3

    mul-float/2addr v2, v8

    add-float/2addr v1, v2

    aput v1, p3, v0

    .line 843
    add-int/lit8 v0, p4, 0x2

    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mV:[F

    const/4 v2, 0x2

    aget v1, v1, v2

    mul-float/2addr v1, v6

    add-float/2addr v1, v7

    mul-float/2addr v1, v8

    aput v1, p3, v0

    .line 844
    return-void
.end method

.method private prvDown(Lcom/nemustech/tiffany/world/TFModel;FF)V
    .locals 2
    .parameter "selectedModel"
    .parameter "x"
    .parameter "y"

    .prologue
    .line 674
    if-eqz p1, :cond_0

    .line 675
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->getLockStatus()Z

    move-result v0

    if-nez v0, :cond_3

    .line 678
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->isIgnoreMovementOnSelect()Z

    move-result v0

    if-nez v0, :cond_1

    .line 679
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->isGoingToStop()Z

    move-result v0

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mValidDown:Z

    .line 686
    :goto_0
    const-string v0, "TFRenderer"

    const-string v1, "Touch Down"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 688
    iget-object v0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    if-eqz v0, :cond_2

    .line 689
    iget-object v0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    iget v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedFaceIndex:I

    invoke-virtual {v0, p1, v1, p2, p3}, Lcom/nemustech/tiffany/world/TFHolder;->handleDown(Lcom/nemustech/tiffany/world/TFModel;IFF)V

    .line 705
    :cond_0
    :goto_1
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 706
    return-void

    .line 683
    :cond_1
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mValidDown:Z

    goto :goto_0

    .line 692
    :cond_2
    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedFaceIndex:I

    invoke-virtual {p1, v0, p2, p3}, Lcom/nemustech/tiffany/world/TFModel;->handleDown(IFF)Z

    goto :goto_1

    .line 695
    :cond_3
    const-string v0, "TFRenderer"

    const-string v1, "Down detected, but the selectedModel is locked!!"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_1
.end method

.method private prvDrag(Lcom/nemustech/tiffany/world/TFModel;FFFFI)V
    .locals 7
    .parameter "selectedModel"
    .parameter "sx"
    .parameter "sy"
    .parameter "ex"
    .parameter "ey"
    .parameter "tickPassed"

    .prologue
    .line 646
    if-eqz p1, :cond_0

    .line 647
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->getLockStatus()Z

    move-result v0

    if-nez v0, :cond_2

    .line 654
    iget-object v0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    if-eqz v0, :cond_1

    .line 655
    iget-object v0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    move-object v1, p1

    move v2, p2

    move v3, p3

    move v4, p4

    move v5, p5

    move v6, p6

    invoke-virtual/range {v0 .. v6}, Lcom/nemustech/tiffany/world/TFHolder;->handleDrag(Lcom/nemustech/tiffany/world/TFModel;FFFFI)V

    .line 670
    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 671
    return-void

    .line 658
    :cond_1
    invoke-virtual/range {p1 .. p6}, Lcom/nemustech/tiffany/world/TFModel;->handleDrag(FFFFI)Z

    goto :goto_0

    .line 660
    :cond_2
    const-string v0, "TFRenderer"

    const-string v1, "Drag on locked model."

    invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method private prvUp(Lcom/nemustech/tiffany/world/TFModel;FF)V
    .locals 3
    .parameter "selectedModel"
    .parameter "x"
    .parameter "y"

    .prologue
    .line 710
    if-eqz p1, :cond_0

    .line 711
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->getLockStatus()Z

    move-result v0

    if-nez v0, :cond_2

    .line 712
    const-string v0, "TFRenderer"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "Touch Up on "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 714
    iget-object v0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    if-eqz v0, :cond_1

    .line 715
    iget-object v0, p1, Lcom/nemustech/tiffany/world/TFModel;->mParentHolder:Lcom/nemustech/tiffany/world/TFHolder;

    invoke-virtual {v0, p1, p2, p3}, Lcom/nemustech/tiffany/world/TFHolder;->handleUp(Lcom/nemustech/tiffany/world/TFModel;FF)V

    .line 728
    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 729
    return-void

    .line 717
    :cond_1
    invoke-virtual {p1, p2, p3}, Lcom/nemustech/tiffany/world/TFModel;->handleUp(FF)Z

    goto :goto_0

    .line 719
    :cond_2
    const-string v0, "TFRenderer"

    const-string v1, "Locked!!"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method static removeHelper(Lcom/nemustech/tiffany/world/TFHolder;ZZ)V
    .locals 2
    .parameter "holder"
    .parameter "bTextureOnly"
    .parameter "textureMode"

    .prologue
    .line 430
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFHolder;->isTerminalHolder()Z

    move-result v1

    if-eqz v1, :cond_1

    .line 431
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFHolder;->getSlotCount()I

    move-result v1

    if-ge v0, v1, :cond_2

    .line 432
    if-eqz p1, :cond_0

    .line 433
    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFHolder;->getModelInSlot(I)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v1

    invoke-virtual {v1, p2}, Lcom/nemustech/tiffany/world/TFModel;->handleTextureMemory(Z)V

    .line 431
    :goto_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 435
    :cond_0
    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFHolder;->getModelInSlot(I)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v1

    invoke-virtual {v1}, Lcom/nemustech/tiffany/world/TFModel;->deleteAllImageResource()V

    goto :goto_1

    .line 438
    .end local v0           #i:I
    :cond_1
    const/4 v0, 0x0

    .restart local v0       #i:I
    :goto_2
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFHolder;->getSlotCount()I

    move-result v1

    if-ge v0, v1, :cond_2

    .line 439
    invoke-virtual {p0, v0}, Lcom/nemustech/tiffany/world/TFHolder;->getHolderInSlot(I)Lcom/nemustech/tiffany/world/TFHolder;

    move-result-object v1

    invoke-static {v1, p1, p2}, Lcom/nemustech/tiffany/world/TFRenderer;->removeHelper(Lcom/nemustech/tiffany/world/TFHolder;ZZ)V

    .line 438
    add-int/lit8 v0, v0, 0x1

    goto :goto_2

    .line 442
    :cond_2
    return-void
.end method

.method private unProject(FFF[FI[FI[II[FI)Z
    .locals 10
    .parameter "winx"
    .parameter "winy"
    .parameter "winz"
    .parameter "model"
    .parameter "offsetM"
    .parameter "proj"
    .parameter "offsetP"
    .parameter "viewport"
    .parameter "offsetV"
    .parameter "xyz"
    .parameter "offset"

    .prologue
    .line 850
    const/16 v1, 0x28

    new-array v0, v1, [F

    .line 851
    .local v0, _tempGluUnProjectData:[F
    const/4 v8, 0x0

    .line 852
    .local v8, _temp_m:I
    const/16 v6, 0x10

    .line 853
    .local v6, _temp_A:I
    const/16 v7, 0x20

    .line 854
    .local v7, _temp_in:I
    const/16 v9, 0x24

    .line 857
    .local v9, _temp_out:I
    const/16 v1, 0x20

    aget v2, p8, p9

    int-to-float v2, v2

    sub-float v2, p1, v2

    const/high16 v3, 0x4000

    mul-float/2addr v2, v3

    add-int/lit8 v3, p9, 0x2

    aget v3, p8, v3

    int-to-float v3, v3

    div-float/2addr v2, v3

    const/high16 v3, 0x3f80

    sub-float/2addr v2, v3

    aput v2, v0, v1

    .line 859
    const/16 v1, 0x21

    add-int/lit8 v2, p9, 0x1

    aget v2, p8, v2

    int-to-float v2, v2

    sub-float v2, p2, v2

    const/high16 v3, 0x4000

    mul-float/2addr v2, v3

    add-int/lit8 v3, p9, 0x3

    aget v3, p8, v3

    int-to-float v3, v3

    div-float/2addr v2, v3

    const/high16 v3, 0x3f80

    sub-float/2addr v2, v3

    aput v2, v0, v1

    .line 861
    const/16 v1, 0x22

    const/high16 v2, 0x4000

    mul-float/2addr v2, p3

    const/high16 v3, 0x3f80

    sub-float/2addr v2, v3

    aput v2, v0, v1

    .line 862
    const/16 v1, 0x23

    const/high16 v2, 0x3f80

    aput v2, v0, v1

    .line 865
    const/16 v1, 0x10

    move-object/from16 v2, p6

    move/from16 v3, p7

    move-object v4, p4

    move v5, p5

    invoke-static/range {v0 .. v5}, Landroid/opengl/Matrix;->multiplyMM([FI[FI[FI)V

    .line 867
    const/4 v1, 0x0

    const/16 v2, 0x10

    invoke-static {v0, v1, v0, v2}, Landroid/opengl/Matrix;->invertM([FI[FI)Z

    .line 870
    const/16 v1, 0x24

    const/4 v3, 0x0

    const/16 v5, 0x20

    move-object v2, v0

    move-object v4, v0

    invoke-static/range {v0 .. v5}, Landroid/opengl/Matrix;->multiplyMV([FI[FI[FI)V

    .line 874
    const/16 v1, 0x27

    aget v1, v0, v1

    float-to-double v1, v1

    const-wide/16 v3, 0x0

    cmpl-double v1, v1, v3

    if-nez v1, :cond_0

    .line 875
    const/4 v1, 0x0

    .line 883
    :goto_0
    return v1

    .line 877
    :cond_0
    const/16 v1, 0x24

    aget v1, v0, v1

    const/16 v2, 0x27

    aget v2, v0, v2

    div-float/2addr v1, v2

    aput v1, p10, p11

    .line 879
    add-int/lit8 v1, p11, 0x1

    const/16 v2, 0x25

    aget v2, v0, v2

    const/16 v3, 0x27

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p10, v1

    .line 881
    add-int/lit8 v1, p11, 0x2

    const/16 v2, 0x26

    aget v2, v0, v2

    const/16 v3, 0x27

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p10, v1

    .line 883
    const/4 v1, 0x1

    goto :goto_0
.end method


# virtual methods
.method add(Lcom/nemustech/tiffany/world/TFHolder;)V
    .locals 2
    .parameter "holder"

    .prologue
    .line 405
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 407
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

    invoke-virtual {v1, p1}, Lcom/nemustech/tiffany/world/TFWorld$Layer;->add(Ljava/lang/Object;)Z

    .line 408
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

    invoke-virtual {p1, v1}, Lcom/nemustech/tiffany/world/TFHolder;->setLayer(Lcom/nemustech/tiffany/world/TFWorld$Layer;)V

    .line 410
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 411
    monitor-exit v0

    .line 412
    return-void

    .line 411
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method add(Lcom/nemustech/tiffany/world/TFModel;)V
    .locals 2
    .parameter "model"

    .prologue
    .line 384
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 385
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

    invoke-virtual {v1, p1}, Lcom/nemustech/tiffany/world/TFWorld$Layer;->add(Ljava/lang/Object;)Z

    .line 386
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

    invoke-virtual {p1, v1}, Lcom/nemustech/tiffany/world/TFModel;->setLayer(Lcom/nemustech/tiffany/world/TFWorld$Layer;)V

    .line 387
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 388
    monitor-exit v0

    .line 389
    return-void

    .line 388
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method addLayer()Lcom/nemustech/tiffany/world/TFWorld$Layer;
    .locals 3

    .prologue
    .line 339
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 340
    :try_start_0
    new-instance v0, Lcom/nemustech/tiffany/world/TFWorld$Layer;

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v2}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    invoke-direct {v0, v2}, Lcom/nemustech/tiffany/world/TFWorld$Layer;-><init>(Lcom/nemustech/tiffany/world/TFWorld;)V

    .line 341
    .local v0, layer:Lcom/nemustech/tiffany/world/TFWorld$Layer;
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    invoke-virtual {v2, v0}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 342
    monitor-exit v1

    return-object v0

    .line 343
    .end local v0           #layer:Lcom/nemustech/tiffany/world/TFWorld$Layer;
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2
.end method

.method getActiveLayer()Lcom/nemustech/tiffany/world/TFWorld$Layer;
    .locals 2

    .prologue
    .line 347
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 348
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

    monitor-exit v0

    return-object v1

    .line 349
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public getConfigSpec()[I
    .locals 3

    .prologue
    .line 212
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v2}, Lcom/nemustech/tiffany/world/TFWorld;->isTranslucentMode()Z

    move-result v2

    if-eqz v2, :cond_0

    .line 214
    const/16 v2, 0xb

    new-array v0, v2, [I

    fill-array-data v0, :array_0

    .local v0, configSpec:[I
    move-object v1, v0

    .line 222
    .end local v0           #configSpec:[I
    .local v1, configSpec:[I
    :goto_0
    return-object v1

    .line 221
    .end local v1           #configSpec:[I
    :cond_0
    const/4 v2, 0x3

    new-array v0, v2, [I

    fill-array-data v0, :array_1

    .restart local v0       #configSpec:[I
    move-object v1, v0

    .line 222
    .end local v0           #configSpec:[I
    .restart local v1       #configSpec:[I
    goto :goto_0

    .line 214
    nop

    :array_0
    .array-data 0x4
        0x24t 0x30t 0x0t 0x0t
        0x8t 0x0t 0x0t 0x0t
        0x23t 0x30t 0x0t 0x0t
        0x8t 0x0t 0x0t 0x0t
        0x22t 0x30t 0x0t 0x0t
        0x8t 0x0t 0x0t 0x0t
        0x21t 0x30t 0x0t 0x0t
        0x8t 0x0t 0x0t 0x0t
        0x25t 0x30t 0x0t 0x0t
        0x10t 0x0t 0x0t 0x0t
        0x38t 0x30t 0x0t 0x0t
    .end array-data

    .line 221
    :array_1
    .array-data 0x4
        0x25t 0x30t 0x0t 0x0t
        0x10t 0x0t 0x0t 0x0t
        0x38t 0x30t 0x0t 0x0t
    .end array-data
.end method

.method getFaceVertices(Lcom/nemustech/tiffany/world/TFModel;I[F)V
    .locals 12
    .parameter "model"
    .parameter "faceIndex"
    .parameter "vertices"

    .prologue
    const/4 v11, 0x1

    const/4 v10, 0x4

    .line 589
    const-class v5, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v5

    .line 590
    const/4 v0, 0x4

    .line 591
    .local v0, VERTEX_NUM_OF_POLYGON:I
    const/16 v2, 0x8

    .line 593
    .local v2, numVertices:I
    :try_start_0
    iget-object v6, p1, Lcom/nemustech/tiffany/world/TFModel;->mMatrix:[F

    const/4 v7, 0x0

    invoke-direct {p0, v6, v7}, Lcom/nemustech/tiffany/world/TFRenderer;->computeMVP([FI)V

    .line 595
    array-length v6, p3

    if-ne v6, v2, :cond_2

    .line 596
    new-array v4, v2, [F

    .line 599
    .local v4, rasterVertices:[F
    const/4 v1, 0x0

    .local v1, j:I
    :goto_0
    if-ge v1, v10, :cond_1

    .line 600
    mul-int/lit8 v6, p2, 0xc

    mul-int/lit8 v7, v1, 0x3

    add-int v3, v6, v7

    .line 601
    .local v3, offset:I
    sget-object v6, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v7, 0x0

    iget-object v8, p1, Lcom/nemustech/tiffany/world/TFModel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    invoke-virtual {v8, v3}, Ljava/nio/FloatBuffer;->get(I)F

    move-result v8

    aput v8, v6, v7

    .line 602
    sget-object v6, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v7, 0x1

    iget-object v8, p1, Lcom/nemustech/tiffany/world/TFModel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    add-int/lit8 v9, v3, 0x1

    invoke-virtual {v8, v9}, Ljava/nio/FloatBuffer;->get(I)F

    move-result v8

    aput v8, v6, v7

    .line 603
    sget-object v6, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v7, 0x2

    iget-object v8, p1, Lcom/nemustech/tiffany/world/TFModel;->mVertexBuffer:Ljava/nio/FloatBuffer;

    add-int/lit8 v9, v3, 0x2

    invoke-virtual {v8, v9}, Ljava/nio/FloatBuffer;->get(I)F

    move-result v8

    aput v8, v6, v7

    .line 604
    sget-object v6, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v7, 0x3

    const/high16 v8, 0x3f80

    aput v8, v6, v7

    .line 606
    sget-object v6, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v7, 0x0

    sget-object v8, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v9, 0x4

    invoke-direct {p0, v6, v7, v8, v9}, Lcom/nemustech/tiffany/world/TFRenderer;->project([FI[FI)V

    .line 608
    if-le v1, v11, :cond_0

    .line 609
    sub-int v6, v10, v1

    add-int/lit8 v6, v6, 0x1

    mul-int/lit8 v6, v6, 0x2

    sget-object v7, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v8, 0x4

    aget v7, v7, v8

    aput v7, v4, v6

    .line 610
    sub-int v6, v10, v1

    add-int/lit8 v6, v6, 0x1

    mul-int/lit8 v6, v6, 0x2

    add-int/lit8 v6, v6, 0x1

    sget-object v7, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v8, 0x5

    aget v7, v7, v8

    aput v7, v4, v6

    .line 599
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 612
    :cond_0
    mul-int/lit8 v6, v1, 0x2

    sget-object v7, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v8, 0x4

    aget v7, v7, v8

    aput v7, v4, v6

    .line 613
    mul-int/lit8 v6, v1, 0x2

    add-int/lit8 v6, v6, 0x1

    sget-object v7, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v8, 0x5

    aget v7, v7, v8

    aput v7, v4, v6

    goto :goto_1

    .line 619
    .end local v1           #j:I
    .end local v3           #offset:I
    .end local v4           #rasterVertices:[F
    :catchall_0
    move-exception v6

    monitor-exit v5
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v6

    .line 617
    .restart local v1       #j:I
    .restart local v4       #rasterVertices:[F
    :cond_1
    const/4 v6, 0x0

    const/4 v7, 0x0

    :try_start_1
    invoke-static {v4, v6, p3, v7, v2}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 619
    .end local v1           #j:I
    .end local v4           #rasterVertices:[F
    :cond_2
    monitor-exit v5
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 620
    return-void
.end method

.method getHitTestLine(FF[F)V
    .locals 1
    .parameter "x"
    .parameter "y"
    .parameter "hitLine"

    .prologue
    .line 888
    const/4 v0, 0x0

    invoke-virtual {p0, p1, p2, p3, v0}, Lcom/nemustech/tiffany/world/TFRenderer;->getHitTestLine(FF[FI)V

    .line 889
    return-void
.end method

.method getHitTestLine(FF[FI)V
    .locals 10
    .parameter "x"
    .parameter "y"
    .parameter "hitLine"
    .parameter "hitLineOffset"

    .prologue
    .line 893
    const/4 v8, 0x0

    .line 894
    .local v8, _result:I
    const/16 v7, 0x8

    .line 895
    .local v7, _invertV:I
    const/16 v6, 0x18

    .line 896
    .local v6, _dc:I
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUnViewportBuffer:[F

    .line 899
    .local v0, m:[F
    const/16 v1, 0x18

    const/16 v2, 0x1c

    iget v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLeft:I

    int-to-float v3, v3

    sub-float v3, p1, v3

    const/high16 v4, 0x4000

    mul-float/2addr v3, v4

    iget v4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWidth:I

    int-to-float v4, v4

    div-float/2addr v3, v4

    const/high16 v4, 0x3f80

    sub-float/2addr v3, v4

    aput v3, v0, v2

    aput v3, v0, v1

    .line 900
    const/16 v1, 0x19

    const/16 v2, 0x1d

    const/high16 v3, 0x3f80

    iget v4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mTop:I

    int-to-float v4, v4

    sub-float v4, p2, v4

    const/high16 v5, 0x4000

    mul-float/2addr v4, v5

    iget v5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHeight:I

    int-to-float v5, v5

    div-float/2addr v4, v5

    sub-float/2addr v3, v4

    aput v3, v0, v2

    aput v3, v0, v1

    .line 901
    const/16 v1, 0x1a

    const/4 v2, 0x0

    aput v2, v0, v1

    .line 902
    const/16 v1, 0x1e

    const/high16 v2, 0x3f80

    aput v2, v0, v1

    .line 903
    const/16 v1, 0x1b

    const/16 v2, 0x1f

    const/high16 v3, 0x3f80

    aput v3, v0, v2

    aput v3, v0, v1

    .line 905
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v1}, Lcom/nemustech/tiffany/world/TFWorld;->getCamera()Lcom/nemustech/tiffany/world/TFCamera;

    move-result-object v1

    iget-object v9, v1, Lcom/nemustech/tiffany/world/TFCamera;->mMatrix:[F

    .line 906
    .local v9, cameraMatrix:[F
    const/16 v1, 0x8

    const/4 v2, 0x0

    invoke-static {v0, v1, v9, v2}, Landroid/opengl/Matrix;->invertM([FI[FI)Z

    move-result v1

    if-nez v1, :cond_0

    .line 912
    :cond_0
    const/4 v1, 0x0

    const/16 v3, 0x8

    const/16 v5, 0x18

    move-object v2, v0

    move-object v4, v0

    invoke-static/range {v0 .. v5}, Landroid/opengl/Matrix;->multiplyMV([FI[FI[FI)V

    .line 913
    const/4 v1, 0x4

    const/16 v3, 0x8

    const/16 v5, 0x1c

    move-object v2, v0

    move-object v4, v0

    invoke-static/range {v0 .. v5}, Landroid/opengl/Matrix;->multiplyMV([FI[FI[FI)V

    .line 915
    add-int/lit8 v1, p4, 0x0

    const/4 v2, 0x0

    aget v2, v0, v2

    const/4 v3, 0x3

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 916
    add-int/lit8 v1, p4, 0x1

    const/4 v2, 0x1

    aget v2, v0, v2

    const/4 v3, 0x3

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 917
    add-int/lit8 v1, p4, 0x2

    const/4 v2, 0x2

    aget v2, v0, v2

    const/4 v3, 0x3

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 918
    add-int/lit8 v1, p4, 0x3

    const/4 v2, 0x3

    aget v2, v0, v2

    const/4 v3, 0x3

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 919
    add-int/lit8 v1, p4, 0x4

    const/4 v2, 0x4

    aget v2, v0, v2

    const/4 v3, 0x7

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 920
    add-int/lit8 v1, p4, 0x5

    const/4 v2, 0x5

    aget v2, v0, v2

    const/4 v3, 0x7

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 921
    add-int/lit8 v1, p4, 0x6

    const/4 v2, 0x6

    aget v2, v0, v2

    const/4 v3, 0x7

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 922
    add-int/lit8 v1, p4, 0x7

    const/4 v2, 0x7

    aget v2, v0, v2

    const/4 v3, 0x7

    aget v3, v0, v3

    div-float/2addr v2, v3

    aput v2, p3, v1

    .line 931
    return-void
.end method

.method getLayer(I)Lcom/nemustech/tiffany/world/TFWorld$Layer;
    .locals 2
    .parameter "index"

    .prologue
    .line 367
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 368
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    invoke-virtual {v1, p1}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object p0

    .end local p0
    check-cast p0, Lcom/nemustech/tiffany/world/TFWorld$Layer;

    monitor-exit v0

    return-object p0

    .line 369
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method getLayerCount()I
    .locals 2

    .prologue
    .line 361
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 362
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    invoke-virtual {v1}, Ljava/util/LinkedList;->size()I

    move-result v1

    monitor-exit v0

    return v1

    .line 363
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method getRasterizedVertices([F[F[F)V
    .locals 7
    .parameter "matrixModelView"
    .parameter "glVertices"
    .parameter "rasterizedVertices"

    .prologue
    .line 569
    const-class v2, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v2

    .line 570
    const/4 v3, 0x0

    :try_start_0
    invoke-direct {p0, p1, v3}, Lcom/nemustech/tiffany/world/TFRenderer;->computeMVP([FI)V

    .line 572
    array-length v3, p2

    div-int/lit8 v1, v3, 0x3

    .line 574
    .local v1, numVertices:I
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    if-ge v0, v1, :cond_0

    .line 575
    sget-object v3, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v4, 0x0

    mul-int/lit8 v5, v0, 0x3

    aget v5, p2, v5

    aput v5, v3, v4

    .line 576
    sget-object v3, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v4, 0x1

    mul-int/lit8 v5, v0, 0x3

    add-int/lit8 v5, v5, 0x1

    aget v5, p2, v5

    aput v5, v3, v4

    .line 577
    sget-object v3, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v4, 0x2

    mul-int/lit8 v5, v0, 0x3

    add-int/lit8 v5, v5, 0x2

    aget v5, p2, v5

    aput v5, v3, v4

    .line 578
    sget-object v3, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v4, 0x3

    const/high16 v5, 0x3f80

    aput v5, v3, v4

    .line 580
    sget-object v3, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v4, 0x0

    sget-object v5, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v6, 0x4

    invoke-direct {p0, v3, v4, v5, v6}, Lcom/nemustech/tiffany/world/TFRenderer;->project([FI[FI)V

    .line 581
    sget-object v3, Lcom/nemustech/tiffany/world/TFRenderer;->mScratch:[F

    const/4 v4, 0x4

    mul-int/lit8 v5, v0, 0x2

    const/4 v6, 0x2

    invoke-static {v3, v4, p3, v5, v6}, Ljava/lang/System;->arraycopy(Ljava/lang/Object;ILjava/lang/Object;II)V

    .line 574
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 583
    :cond_0
    monitor-exit v2

    .line 584
    return-void

    .line 583
    .end local v0           #i:I
    .end local v1           #numVertices:I
    :catchall_0
    move-exception v3

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v3
.end method

.method getSelectedFaceIndex(Lcom/nemustech/tiffany/world/TFModel;FF[F)I
    .locals 3
    .parameter "model"
    .parameter "x"
    .parameter "y"
    .parameter "near"

    .prologue
    .line 623
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 624
    :try_start_0
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHitTestLine:[F

    invoke-virtual {p1, v2}, Lcom/nemustech/tiffany/world/TFModel;->updateHitTestLine([F)V

    .line 625
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->updateHitPoint()V

    .line 626
    invoke-virtual {p1, p4}, Lcom/nemustech/tiffany/world/TFModel;->getHitFace([F)I

    move-result v0

    .line 628
    .local v0, ret:I
    monitor-exit v1

    return v0

    .line 629
    .end local v0           #ret:I
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2
.end method

.method getSelectedModel(FF)Lcom/nemustech/tiffany/world/TFModel;
    .locals 13
    .parameter "x"
    .parameter "y"

    .prologue
    .line 483
    const-class v12, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v12

    .line 486
    :try_start_0
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-boolean v0, v0, Lcom/nemustech/tiffany/world/TFWorld;->mBanQueryingMatrix:Z

    if-eqz v0, :cond_0

    .line 487
    const/4 v0, 0x0

    monitor-exit v12

    .line 524
    :goto_0
    return-object v0

    .line 489
    :cond_0
    const/4 v0, -0x1

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedFaceIndex:I

    .line 490
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    .line 492
    const/4 v10, 0x0

    .line 494
    .local v10, selectedModel:Lcom/nemustech/tiffany/world/TFModel;
    const/4 v0, 0x1

    new-array v5, v0, [F

    const/4 v0, 0x0

    const/4 v1, 0x0

    aput v1, v5, v0

    .line 496
    .local v5, near:[F
    const/4 v10, 0x0

    .line 497
    const v4, -0x39e3c000

    .line 499
    .local v4, nearest:F
    const-string v0, "TFRenderer"

    const-string v1, "++getSelectedModel"

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 500
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHitTestLine:[F

    invoke-virtual {p0, p1, p2, v0}, Lcom/nemustech/tiffany/world/TFRenderer;->getHitTestLine(FF[F)V

    .line 502
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    invoke-virtual {v0}, Ljava/util/LinkedList;->size()I

    move-result v9

    .line 504
    .local v9, layerCount:I
    const/4 v0, 0x1

    sub-int v8, v9, v0

    .local v8, j:I
    :goto_1
    if-ltz v8, :cond_2

    .line 505
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    invoke-virtual {v0, v8}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/util/LinkedList;

    .line 507
    .local v6, attachOrder:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    invoke-virtual {v6}, Ljava/util/LinkedList;->size()I

    move-result v11

    .line 510
    .local v11, size:I
    const/4 v0, 0x1

    sub-int v7, v11, v0

    .local v7, i:I
    :goto_2
    if-ltz v7, :cond_1

    .line 511
    invoke-virtual {v6, v7}, Ljava/util/LinkedList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/nemustech/tiffany/world/TFObject;

    .local v1, o:Lcom/nemustech/tiffany/world/TFObject;
    move-object v0, p0

    move v2, p1

    move v3, p2

    .line 512
    invoke-direct/range {v0 .. v5}, Lcom/nemustech/tiffany/world/TFRenderer;->findSelectedModel(Lcom/nemustech/tiffany/world/TFObject;FFF[F)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v10

    .line 513
    if-eqz v10, :cond_3

    .line 516
    .end local v1           #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_1
    if-eqz v10, :cond_4

    .line 517
    invoke-virtual {v10, v5}, Lcom/nemustech/tiffany/world/TFModel;->getHitFace([F)I

    move-result v0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedFaceIndex:I

    .line 518
    iput-object v10, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    .line 523
    .end local v6           #attachOrder:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    .end local v7           #i:I
    .end local v11           #size:I
    :cond_2
    const-string v0, "TFRenderer"

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "--getSelectedModel with "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1, v10}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 524
    monitor-exit v12

    move-object v0, v10

    goto :goto_0

    .line 510
    .restart local v1       #o:Lcom/nemustech/tiffany/world/TFObject;
    .restart local v6       #attachOrder:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    .restart local v7       #i:I
    .restart local v11       #size:I
    :cond_3
    add-int/lit8 v7, v7, -0x1

    goto :goto_2

    .line 504
    .end local v1           #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_4
    add-int/lit8 v8, v8, -0x1

    goto :goto_1

    .line 525
    .end local v4           #nearest:F
    .end local v5           #near:[F
    .end local v6           #attachOrder:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    .end local v7           #i:I
    .end local v8           #j:I
    .end local v9           #layerCount:I
    .end local v10           #selectedModel:Lcom/nemustech/tiffany/world/TFModel;
    .end local v11           #size:I
    :catchall_0
    move-exception v0

    monitor-exit v12
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public getWorld()Lcom/nemustech/tiffany/world/TFWorld;
    .locals 1

    .prologue
    .line 207
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    return-object v0
.end method

.method public handleDown(FFJ)V
    .locals 4
    .parameter "x"
    .parameter "y"
    .parameter "currentTick"

    .prologue
    .line 732
    const-class v2, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v2

    .line 733
    :try_start_0
    iput p1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownX:F

    .line 734
    iput p2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownY:F

    .line 735
    iput p1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHoldStartX:F

    .line 736
    iput p2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHoldStartY:F

    .line 738
    iput-wide p3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownTick:J

    .line 739
    const/4 v3, 0x0

    iput-boolean v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mCancelSelection:Z

    .line 743
    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownX:F

    .line 744
    .local v0, tx:F
    iget v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownY:F

    .line 746
    .local v1, ty:F
    invoke-virtual {p0, v0, v1}, Lcom/nemustech/tiffany/world/TFRenderer;->getSelectedModel(FF)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v3

    iput-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    .line 747
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    invoke-direct {p0, v3, v0, v1}, Lcom/nemustech/tiffany/world/TFRenderer;->prvDown(Lcom/nemustech/tiffany/world/TFModel;FF)V

    .line 748
    monitor-exit v2

    .line 749
    return-void

    .line 748
    .end local v0           #tx:F
    .end local v1           #ty:F
    :catchall_0
    move-exception v3

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v3
.end method

.method public handleDrag(FFFFJ)V
    .locals 8
    .parameter "start_x"
    .parameter "start_y"
    .parameter "end_x"
    .parameter "end_y"
    .parameter "currentTick"

    .prologue
    .line 773
    const-class v7, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v7

    .line 778
    :try_start_0
    iput p1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartX:F

    .line 779
    iput p2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartY:F

    .line 780
    iput p3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mEndX:F

    .line 781
    iput p4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mEndY:F

    .line 783
    iget-wide v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevDragTick:J

    const-wide/16 v2, 0x0

    cmp-long v0, v0, v2

    if-nez v0, :cond_6

    .line 784
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDragInterval:J

    .line 788
    :goto_0
    iput-wide p5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevDragTick:J

    .line 790
    iget-boolean v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mCancelSelection:Z

    if-nez v0, :cond_3

    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHoldStartX:F

    sub-float v0, p3, v0

    invoke-static {v0}, Ljava/lang/Math;->abs(F)F

    move-result v0

    const/high16 v1, 0x41c8

    cmpl-float v0, v0, v1

    if-gez v0, :cond_0

    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHoldStartY:F

    sub-float v0, p4, v0

    invoke-static {v0}, Ljava/lang/Math;->abs(F)F

    move-result v0

    const/high16 v1, 0x41c8

    cmpl-float v0, v0, v1

    if-ltz v0, :cond_3

    .line 793
    :cond_0
    iput-wide p5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownTick:J

    .line 794
    iput p3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHoldStartX:F

    .line 795
    iput p4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHoldStartY:F

    .line 797
    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownX:F

    cmpl-float v0, p1, v0

    if-nez v0, :cond_1

    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownY:F

    cmpl-float v0, p2, v0

    if-eqz v0, :cond_2

    .line 798
    :cond_1
    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownX:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartX:F

    .line 799
    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownY:F

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartY:F

    .line 801
    :cond_2
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mCancelSelection:Z

    .line 804
    :cond_3
    iget-boolean v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mCancelSelection:Z

    if-eqz v0, :cond_5

    .line 805
    iget v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartX:F

    .line 806
    .local v2, tStartX:F
    iget v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mStartY:F

    .line 807
    .local v3, tStartY:F
    iget v4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mEndX:F

    .line 808
    .local v4, tEndX:F
    iget v5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mEndY:F

    .line 809
    .local v5, tEndY:F
    iget-wide v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDragInterval:J

    long-to-int v6, v0

    .line 811
    .local v6, tTickPassed:I
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    if-nez v0, :cond_4

    .line 812
    invoke-virtual {p0, v4, v5}, Lcom/nemustech/tiffany/world/TFRenderer;->getSelectedModel(FF)Lcom/nemustech/tiffany/world/TFModel;

    move-result-object v0

    iput-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    .line 814
    :cond_4
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    move-object v0, p0

    invoke-direct/range {v0 .. v6}, Lcom/nemustech/tiffany/world/TFRenderer;->prvDrag(Lcom/nemustech/tiffany/world/TFModel;FFFFI)V

    .line 817
    .end local v2           #tStartX:F
    .end local v3           #tStartY:F
    .end local v4           #tEndX:F
    .end local v5           #tEndY:F
    .end local v6           #tTickPassed:I
    :cond_5
    monitor-exit v7

    .line 818
    return-void

    .line 786
    :cond_6
    iget-wide v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevDragTick:J

    sub-long v0, p5, v0

    iput-wide v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDragInterval:J

    goto :goto_0

    .line 817
    :catchall_0
    move-exception v0

    monitor-exit v7
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v0
.end method

.method public handleTap(FF)I
    .locals 3
    .parameter "x"
    .parameter "y"

    .prologue
    .line 633
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 635
    :try_start_0
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    if-eqz v1, :cond_0

    iget v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedFaceIndex:I

    const/4 v2, -0x1

    if-eq v1, v2, :cond_0

    .line 636
    const-string v1, "TFRenderer"

    const-string v2, "Touch select"

    invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 637
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    iget v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedFaceIndex:I

    invoke-virtual {v1, v2, p1, p2}, Lcom/nemustech/tiffany/world/TFModel;->handleTap(IFF)Z

    .line 639
    :cond_0
    const/4 v1, 0x0

    monitor-exit v0

    return v1

    .line 640
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method public handleUp(FF)V
    .locals 7
    .parameter "x"
    .parameter "y"

    .prologue
    const/high16 v6, 0x41c8

    .line 752
    const-class v2, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v2

    .line 753
    const-wide/16 v3, 0x0

    :try_start_0
    iput-wide v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownTick:J

    .line 754
    iput p1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUpX:F

    .line 755
    iput p2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUpY:F

    .line 757
    iget v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUpX:F

    .line 758
    .local v0, tx:F
    iget v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mUpY:F

    .line 760
    .local v1, ty:F
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mRecentSelectedModel:Lcom/nemustech/tiffany/world/TFModel;

    invoke-direct {p0, v3, v0, v1}, Lcom/nemustech/tiffany/world/TFRenderer;->prvUp(Lcom/nemustech/tiffany/world/TFModel;FF)V

    .line 761
    const-string v3, "TFRenderer"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "mValidDown : "

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget-boolean v5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mValidDown:Z

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 763
    iget v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownX:F

    sub-float v3, v0, v3

    invoke-static {v3}, Ljava/lang/Math;->abs(F)F

    move-result v3

    cmpg-float v3, v3, v6

    if-gez v3, :cond_0

    iget v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownY:F

    sub-float v3, v1, v3

    invoke-static {v3}, Ljava/lang/Math;->abs(F)F

    move-result v3

    cmpg-float v3, v3, v6

    if-gez v3, :cond_0

    iget-boolean v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mValidDown:Z

    if-eqz v3, :cond_0

    iget-boolean v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mCancelSelection:Z

    if-nez v3, :cond_0

    .line 767
    invoke-virtual {p0, v0, v1}, Lcom/nemustech/tiffany/world/TFRenderer;->handleTap(FF)I

    .line 768
    :cond_0
    monitor-exit v2

    .line 769
    return-void

    .line 768
    .end local v0           #tx:F
    .end local v1           #ty:F
    :catchall_0
    move-exception v3

    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v3
.end method

.method initDrawCount()V
    .locals 1

    .prologue
    .line 334
    const/4 v0, 0x0

    iput v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mDrawCount:I

    .line 335
    return-void
.end method

.method public onDrawFrame(Ljavax/microedition/khronos/opengles/GL10;)V
    .locals 27
    .parameter "gl"

    .prologue
    .line 36
    const-class v26, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v26

    .line 42
    const/16 v4, 0x4100

    :try_start_0
    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glClear(I)V

    .line 44
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    invoke-virtual {v4}, Lcom/nemustech/tiffany/world/TFWorld;->isBlendingMode()Z

    move-result v4

    const/4 v5, 0x1

    if-ne v4, v5, :cond_4

    .line 45
    const/16 v4, 0xbe2

    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glEnable(I)V

    .line 51
    :goto_0
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    invoke-virtual {v4}, Lcom/nemustech/tiffany/world/TFWorld;->isDepthTestMode()Z

    move-result v4

    if-eqz v4, :cond_5

    .line 52
    const/16 v4, 0xb71

    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glEnable(I)V

    .line 58
    :goto_1
    invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J

    move-result-wide v4

    move-wide v0, v4

    move-object/from16 v2, p0

    iput-wide v0, v2, Lcom/nemustech/tiffany/world/TFRenderer;->mCurrTick:J

    .line 60
    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevTick:J

    move-wide v4, v0

    const-wide/16 v6, 0x0

    cmp-long v4, v4, v6

    if-nez v4, :cond_6

    .line 61
    const/16 v25, 0x0

    .line 65
    .local v25, tickPassed:I
    :goto_2
    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCurrTick:J

    move-wide v4, v0

    move-wide v0, v4

    move-object/from16 v2, p0

    iput-wide v0, v2, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevTick:J

    .line 73
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCamera:Lcom/nemustech/tiffany/world/TFCamera;

    move-object v4, v0

    iget-boolean v4, v4, Lcom/nemustech/tiffany/world/TFCamera;->mChangeStatus:Z

    const/4 v5, 0x1

    if-ne v4, v5, :cond_0

    .line 74
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCamera:Lcom/nemustech/tiffany/world/TFCamera;

    move-object v4, v0

    const/4 v5, 0x1

    move-object v0, v4

    move-object/from16 v1, p1

    move/from16 v2, v25

    move v3, v5

    invoke-virtual {v0, v1, v2, v3}, Lcom/nemustech/tiffany/world/TFCamera;->updateObject(Ljavax/microedition/khronos/opengles/GL10;IZ)Z

    .line 75
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCamera:Lcom/nemustech/tiffany/world/TFCamera;

    move-object v5, v0

    move-object/from16 v0, p1

    check-cast v0, Lcom/nemustech/tiffany/world/TFGL;

    move-object v4, v0

    move/from16 v0, v25

    int-to-float v0, v0

    move v6, v0

    invoke-virtual {v5, v4, v6}, Lcom/nemustech/tiffany/world/TFCamera;->updateProjection(Lcom/nemustech/tiffany/world/TFGL;F)Z

    .line 76
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBackground:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    if-eqz v4, :cond_0

    .line 77
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBackground:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    invoke-virtual {v4}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->updateLocation()V

    .line 85
    :cond_0
    const/16 v4, 0x1700

    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glMatrixMode(I)V

    .line 86
    const/16 v4, 0xde1

    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glEnable(I)V

    .line 87
    const/16 v4, 0xb10

    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glEnable(I)V

    .line 88
    invoke-interface/range {p1 .. p1}, Ljavax/microedition/khronos/opengles/GL10;->glLoadIdentity()V

    .line 90
    const/16 v24, 0x0

    .line 91
    .local v24, showAxis:Z
    if-eqz v24, :cond_1

    .line 92
    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/high16 v8, 0x40a0

    const/4 v9, 0x0

    const/4 v10, 0x0

    move-object/from16 v4, p1

    invoke-static/range {v4 .. v10}, Lcom/nemustech/tiffany/world/TFUtils;->drawLine(Ljavax/microedition/khronos/opengles/GL10;FFFFFF)V

    .line 93
    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/high16 v9, 0x40a0

    const/4 v10, 0x0

    move-object/from16 v4, p1

    invoke-static/range {v4 .. v10}, Lcom/nemustech/tiffany/world/TFUtils;->drawLine(Ljavax/microedition/khronos/opengles/GL10;FFFFFF)V

    .line 94
    const/4 v5, 0x0

    const/4 v6, 0x0

    const/4 v7, 0x0

    const/4 v8, 0x0

    const/4 v9, 0x0

    const/high16 v10, 0x40a0

    move-object/from16 v4, p1

    invoke-static/range {v4 .. v10}, Lcom/nemustech/tiffany/world/TFUtils;->drawLine(Ljavax/microedition/khronos/opengles/GL10;FFFFFF)V

    .line 95
    const/high16 v5, -0x4080

    const/high16 v6, 0x3f80

    const/4 v7, 0x0

    const/high16 v8, 0x3f80

    const/high16 v9, 0x3f80

    const/4 v10, 0x0

    move-object/from16 v4, p1

    invoke-static/range {v4 .. v10}, Lcom/nemustech/tiffany/world/TFUtils;->drawLine(Ljavax/microedition/khronos/opengles/GL10;FFFFFF)V

    .line 96
    const/high16 v5, -0x4080

    const/high16 v6, -0x4080

    const/4 v7, 0x0

    const/high16 v8, 0x3f80

    const/high16 v9, -0x4080

    const/4 v10, 0x0

    move-object/from16 v4, p1

    invoke-static/range {v4 .. v10}, Lcom/nemustech/tiffany/world/TFUtils;->drawLine(Ljavax/microedition/khronos/opengles/GL10;FFFFFF)V

    .line 97
    const/high16 v5, -0x4080

    const/high16 v6, 0x3f80

    const/4 v7, 0x0

    const/high16 v8, -0x4080

    const/high16 v9, -0x4080

    const/4 v10, 0x0

    move-object/from16 v4, p1

    invoke-static/range {v4 .. v10}, Lcom/nemustech/tiffany/world/TFUtils;->drawLine(Ljavax/microedition/khronos/opengles/GL10;FFFFFF)V

    .line 98
    const/high16 v5, 0x3f80

    const/high16 v6, 0x3f80

    const/4 v7, 0x0

    const/high16 v8, 0x3f80

    const/high16 v9, -0x4080

    const/4 v10, 0x0

    move-object/from16 v4, p1

    invoke-static/range {v4 .. v10}, Lcom/nemustech/tiffany/world/TFUtils;->drawLine(Ljavax/microedition/khronos/opengles/GL10;FFFFFF)V

    .line 101
    :cond_1
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBackground:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    if-eqz v4, :cond_3

    .line 102
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBackgroundOld:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    if-eqz v4, :cond_2

    .line 103
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBackgroundOld:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    move-object v0, v4

    move-object/from16 v1, p1

    move/from16 v2, v25

    invoke-virtual {v0, v1, v2}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->draw(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 104
    :cond_2
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBackground:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    move-object v0, v4

    move-object/from16 v1, p1

    invoke-virtual {v0, v1}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->update(Ljavax/microedition/khronos/opengles/GL10;)V

    .line 105
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBackground:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    move-object v0, v4

    move-object/from16 v1, p1

    move/from16 v2, v25

    invoke-virtual {v0, v1, v2}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->draw(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 109
    :cond_3
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownTick:J

    move-wide v5, v0

    const-wide/16 v7, 0x0

    cmp-long v5, v5, v7

    if-lez v5, :cond_7

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCurrTick:J

    move-wide v5, v0

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mDownTick:J

    move-wide v7, v0

    sub-long/2addr v5, v7

    const-wide/16 v7, 0x1e

    cmp-long v5, v5, v7

    if-lez v5, :cond_7

    const/4 v5, 0x1

    :goto_3
    iput-boolean v5, v4, Lcom/nemustech/tiffany/world/TFWorld;->mTouchDown:Z

    .line 122
    :goto_4
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    invoke-virtual {v4}, Lcom/nemustech/tiffany/world/TFWorld;->getEvent()Ljava/lang/Runnable;

    move-result-object v23

    .local v23, r:Ljava/lang/Runnable;
    if-eqz v23, :cond_8

    .line 123
    invoke-interface/range {v23 .. v23}, Ljava/lang/Runnable;->run()V

    goto :goto_4

    .line 203
    .end local v23           #r:Ljava/lang/Runnable;
    .end local v24           #showAxis:Z
    .end local v25           #tickPassed:I
    :catchall_0
    move-exception v4

    monitor-exit v26
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v4

    .line 47
    :cond_4
    const/16 v4, 0xbe2

    :try_start_1
    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glDisable(I)V

    goto/16 :goto_0

    .line 54
    :cond_5
    const/16 v4, 0xb71

    move-object/from16 v0, p1

    move v1, v4

    invoke-interface {v0, v1}, Ljavax/microedition/khronos/opengles/GL10;->glDisable(I)V

    goto/16 :goto_1

    .line 63
    :cond_6
    const/16 v4, 0x1e

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCurrTick:J

    move-wide v5, v0

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevTick:J

    move-wide v7, v0

    sub-long/2addr v5, v7

    long-to-int v5, v5

    invoke-static {v4, v5}, Ljava/lang/Math;->min(II)I

    move-result v25

    .restart local v25       #tickPassed:I
    goto/16 :goto_2

    .line 109
    .restart local v24       #showAxis:Z
    :cond_7
    const/4 v5, 0x0

    goto :goto_3

    .line 126
    .restart local v23       #r:Ljava/lang/Runnable;
    :cond_8
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    move-object v4, v0

    invoke-virtual {v4}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v16

    :goto_5
    invoke-interface/range {v16 .. v16}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_c

    invoke-interface/range {v16 .. v16}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v18

    check-cast v18, Lcom/nemustech/tiffany/world/TFWorld$Layer;

    .line 127
    .local v18, layer:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    const/4 v13, 0x0

    .line 129
    .local v13, filteredLayer:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-boolean v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mBlendingSort:Z

    if-eqz v4, :cond_9

    .line 130
    new-instance v13, Ljava/util/LinkedList;

    .end local v13           #filteredLayer:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    move-object v0, v13

    move-object/from16 v1, v18

    invoke-direct {v0, v1}, Ljava/util/LinkedList;-><init>(Ljava/util/Collection;)V

    .line 131
    .restart local v13       #filteredLayer:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    sget-object v4, Lcom/nemustech/tiffany/world/TFObject;->compareAxisZ:Ljava/util/Comparator;

    invoke-static {v13, v4}, Ljava/util/Collections;->sort(Ljava/util/List;Ljava/util/Comparator;)V

    .line 136
    :goto_6
    const/4 v4, 0x1

    sput-boolean v4, Lcom/nemustech/tiffany/world/TFRenderer;->isDrawLoop:Z

    .line 137
    invoke-virtual {v13}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v17

    .local v17, i$:Ljava/util/Iterator;
    :goto_7
    invoke-interface/range {v17 .. v17}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_b

    invoke-interface/range {v17 .. v17}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v22

    check-cast v22, Lcom/nemustech/tiffany/world/TFObject;

    .line 138
    .local v22, o:Lcom/nemustech/tiffany/world/TFObject;
    move-object/from16 v0, v22

    instance-of v0, v0, Lcom/nemustech/tiffany/world/TFHolder;

    move v4, v0

    if-eqz v4, :cond_a

    .line 139
    move-object/from16 v0, v22

    check-cast v0, Lcom/nemustech/tiffany/world/TFHolder;

    move-object v14, v0

    .line 140
    .local v14, h:Lcom/nemustech/tiffany/world/TFHolder;
    invoke-interface/range {p1 .. p1}, Ljavax/microedition/khronos/opengles/GL10;->glLoadIdentity()V

    .line 141
    move-object v0, v14

    move-object/from16 v1, p1

    move/from16 v2, v25

    invoke-virtual {v0, v1, v2}, Lcom/nemustech/tiffany/world/TFHolder;->draw(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 142
    invoke-virtual {v14}, Lcom/nemustech/tiffany/world/TFHolder;->checkEffectFinish()V

    goto :goto_7

    .line 133
    .end local v14           #h:Lcom/nemustech/tiffany/world/TFHolder;
    .end local v17           #i$:Ljava/util/Iterator;
    .end local v22           #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_9
    move-object/from16 v13, v18

    goto :goto_6

    .line 144
    .restart local v17       #i$:Ljava/util/Iterator;
    .restart local v22       #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_a
    move-object/from16 v0, v22

    check-cast v0, Lcom/nemustech/tiffany/world/TFModel;

    move-object/from16 v19, v0

    .line 145
    .local v19, m:Lcom/nemustech/tiffany/world/TFModel;
    invoke-interface/range {p1 .. p1}, Ljavax/microedition/khronos/opengles/GL10;->glLoadIdentity()V

    .line 146
    move-object/from16 v0, v19

    move-object/from16 v1, p1

    move/from16 v2, v25

    invoke-virtual {v0, v1, v2}, Lcom/nemustech/tiffany/world/TFModel;->_draw(Ljavax/microedition/khronos/opengles/GL10;I)V

    .line 147
    invoke-virtual/range {v19 .. v19}, Lcom/nemustech/tiffany/world/TFModel;->checkEffectFinish()V

    goto :goto_7

    .line 150
    .end local v19           #m:Lcom/nemustech/tiffany/world/TFModel;
    .end local v22           #o:Lcom/nemustech/tiffany/world/TFObject;
    :cond_b
    const/4 v4, 0x0

    sput-boolean v4, Lcom/nemustech/tiffany/world/TFRenderer;->isDrawLoop:Z

    goto :goto_5

    .line 154
    .end local v13           #filteredLayer:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    .end local v17           #i$:Ljava/util/Iterator;
    .end local v18           #layer:Ljava/util/LinkedList;,"Ljava/util/LinkedList<Lcom/nemustech/tiffany/world/TFObject;>;"
    :cond_c
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    invoke-virtual {v4}, Lcom/nemustech/tiffany/world/TFWorld;->getCamera()Lcom/nemustech/tiffany/world/TFCamera;

    move-result-object v4

    invoke-virtual {v4}, Lcom/nemustech/tiffany/world/TFCamera;->checkEffectFinish()V

    .line 157
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mDrawCount:I

    move v4, v0

    const/4 v5, 0x2

    if-ge v4, v5, :cond_d

    .line 158
    const-wide/16 v4, 0x0

    move-wide v0, v4

    move-object/from16 v2, p0

    iput-wide v0, v2, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevTick:J

    .line 159
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mDrawCount:I

    move v4, v0

    add-int/lit8 v4, v4, 0x1

    move v0, v4

    move-object/from16 v1, p0

    iput v0, v1, Lcom/nemustech/tiffany/world/TFRenderer;->mDrawCount:I

    .line 161
    move-object/from16 v0, p0

    iget v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mDrawCount:I

    move v4, v0

    const/4 v5, 0x2

    if-ne v4, v5, :cond_f

    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mPostDrawListener:Ljava/lang/Runnable;

    if-eqz v4, :cond_f

    .line 162
    const-string v4, "TFRenderer"

    const-string v5, "PostDrawListener status run"

    invoke-static {v4, v5}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 163
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    iget-object v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mPostDrawListener:Ljava/lang/Runnable;

    invoke-interface {v4}, Ljava/lang/Runnable;->run()V

    .line 164
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    const/4 v5, 0x0

    iput-object v5, v4, Lcom/nemustech/tiffany/world/TFWorld;->mPostDrawListener:Ljava/lang/Runnable;

    .line 171
    :cond_d
    :goto_8
    sget-wide v4, Lcom/nemustech/tiffany/world/TFRenderer;->accumulatedDrawingCount:J

    const-wide/16 v6, 0x1

    add-long/2addr v4, v6

    sput-wide v4, Lcom/nemustech/tiffany/world/TFRenderer;->accumulatedDrawingCount:J

    .line 172
    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCurrTick:J

    move-wide v4, v0

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mFPSTick:J

    move-wide v6, v0

    sub-long v11, v4, v6

    .line 173
    .local v11, elapsedTick:J
    const-wide/16 v4, 0xbb8

    cmp-long v4, v11, v4

    if-lez v4, :cond_e

    .line 174
    const/16 v20, 0x0

    .line 175
    .local v20, modelsInHolder:I
    const/16 v21, 0x0

    .line 176
    .local v21, modelsInWorld:I
    const/4 v15, 0x0

    .line 178
    .local v15, holders:I
    const-string v4, "TFRenderer"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    sget-wide v6, Lcom/nemustech/tiffany/world/TFRenderer;->accumulatedDrawingCount:J

    const-wide/16 v8, 0x3e8

    mul-long/2addr v6, v8

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCurrTick:J

    move-wide v8, v0

    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mFPSTick:J

    move-wide v10, v0

    sub-long/2addr v8, v10

    div-long/2addr v6, v8

    invoke-virtual {v5, v6, v7}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, " fps."

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-static {v4, v5}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 193
    const-wide/16 v4, 0x0

    sput-wide v4, Lcom/nemustech/tiffany/world/TFRenderer;->accumulatedDrawingCount:J

    .line 194
    move-object/from16 v0, p0

    iget-wide v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mCurrTick:J

    move-wide v4, v0

    move-wide v0, v4

    move-object/from16 v2, p0

    iput-wide v0, v2, Lcom/nemustech/tiffany/world/TFRenderer;->mFPSTick:J

    .line 203
    .end local v15           #holders:I
    .end local v20           #modelsInHolder:I
    .end local v21           #modelsInWorld:I
    :cond_e
    monitor-exit v26

    .line 204
    return-void

    .line 166
    .end local v11           #elapsedTick:J
    :cond_f
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    move-object v4, v0

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_8
.end method

.method public onPause(Ljavax/microedition/khronos/opengles/GL10;)V
    .locals 2
    .parameter "gl"

    .prologue
    .line 330
    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mPrevTick:J

    .line 331
    return-void
.end method

.method public onSurfaceChanged(Ljavax/microedition/khronos/opengles/GL10;II)V
    .locals 7
    .parameter "gl"
    .parameter "width"
    .parameter "height"

    .prologue
    const/4 v3, 0x0

    .line 228
    move-object v0, p1

    check-cast v0, Lcom/nemustech/tiffany/world/TFGL;

    move-object v2, v0

    .line 230
    .local v2, gl2:Lcom/nemustech/tiffany/world/TFGL;
    iput v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLeft:I

    .line 231
    iput v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mTop:I

    .line 232
    iput p2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWidth:I

    .line 233
    iput p3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHeight:I

    .line 235
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v3, v3, Lcom/nemustech/tiffany/world/TFWorld;->mViewSizeChangeListener:Lcom/nemustech/tiffany/world/TFWorld$OnViewSizeChangeListener;

    if-eqz v3, :cond_0

    .line 236
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v3, v3, Lcom/nemustech/tiffany/world/TFWorld;->mViewSizeChangeListener:Lcom/nemustech/tiffany/world/TFWorld$OnViewSizeChangeListener;

    invoke-interface {v3, p2, p3}, Lcom/nemustech/tiffany/world/TFWorld$OnViewSizeChangeListener;->onViewSizeChanged(II)V

    .line 239
    :cond_0
    const-string v3, "TFRenderer"

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V

    const-string v5, "TFView size changed, width:"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget v5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWidth:I

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    const-string v5, ",height:"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    iget v5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHeight:I

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 241
    iget v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLeft:I

    iget v4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mTop:I

    iget v5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWidth:I

    iget v6, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mHeight:I

    invoke-virtual {v2, v3, v4, v5, v6}, Lcom/nemustech/tiffany/world/TFGL;->glViewport(IIII)V

    .line 243
    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v3}, Lcom/nemustech/tiffany/world/TFWorld;->getCamera()Lcom/nemustech/tiffany/world/TFCamera;

    move-result-object v1

    .line 244
    .local v1, camera:Lcom/nemustech/tiffany/world/TFCamera;
    const/4 v3, 0x0

    invoke-virtual {v1, v2, v3}, Lcom/nemustech/tiffany/world/TFCamera;->updateProjection(Lcom/nemustech/tiffany/world/TFGL;F)Z

    .line 246
    return-void
.end method

.method public onSurfaceCreated(Ljavax/microedition/khronos/opengles/GL10;Ljavax/microedition/khronos/egl/EGLConfig;)V
    .locals 8
    .parameter "gl"
    .parameter "config"

    .prologue
    const/4 v7, 0x1

    const/4 v6, 0x0

    .line 253
    const/16 v2, 0x1f03

    invoke-interface {p1, v2}, Ljavax/microedition/khronos/opengles/GL10;->glGetString(I)Ljava/lang/String;

    move-result-object v1

    .line 254
    .local v1, strExtension:Ljava/lang/String;
    const-string v2, "TFRenderer"

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "OpenGL extension list : "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I

    .line 255
    const-string v2, "GL_OES_query_matrix"

    invoke-virtual {v1, v2}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v2

    const/4 v3, -0x1

    if-eq v2, v3, :cond_4

    .line 256
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-virtual {v2, v7}, Lcom/nemustech/tiffany/world/TFWorld;->setCapability(I)V

    .line 257
    const-string v2, "TFRenderer"

    const-string v3, "Query matrix enabled. Using hardware matrix calculation"

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 270
    :goto_0
    const/16 v2, 0xbd0

    invoke-interface {p1, v2}, Ljavax/microedition/khronos/opengles/GL10;->glDisable(I)V

    .line 276
    const/16 v2, 0xc50

    const/16 v3, 0x1102

    invoke-interface {p1, v2, v3}, Ljavax/microedition/khronos/opengles/GL10;->glHint(II)V

    .line 278
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mColorBackgroundR:F

    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget v3, v3, Lcom/nemustech/tiffany/world/TFWorld;->mColorBackgroundG:F

    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget v4, v4, Lcom/nemustech/tiffany/world/TFWorld;->mColorBackgroundB:F

    iget-object v5, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget v5, v5, Lcom/nemustech/tiffany/world/TFWorld;->mColorBackgroundA:F

    invoke-interface {p1, v2, v3, v4, v5}, Ljavax/microedition/khronos/opengles/GL10;->glClearColor(FFFF)V

    .line 281
    const/16 v2, 0xb44

    invoke-interface {p1, v2}, Ljavax/microedition/khronos/opengles/GL10;->glEnable(I)V

    .line 282
    const/16 v2, 0x1d01

    invoke-interface {p1, v2}, Ljavax/microedition/khronos/opengles/GL10;->glShadeModel(I)V

    .line 283
    const/16 v2, 0x302

    const/16 v3, 0x303

    invoke-interface {p1, v2, v3}, Ljavax/microedition/khronos/opengles/GL10;->glBlendFunc(II)V

    .line 286
    sput-object p1, Lcom/nemustech/tiffany/world/TFRenderer;->mGL:Ljavax/microedition/khronos/opengles/GL10;

    .line 291
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-boolean v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageDisplayMode:Z

    if-eqz v2, :cond_1

    .line 292
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageBmp:Landroid/graphics/Bitmap;

    if-nez v2, :cond_0

    .line 293
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    sget-object v3, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    invoke-static {v7, v7, v3}, Landroid/graphics/Bitmap;->createBitmap(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;

    move-result-object v3

    iput-object v3, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageBmp:Landroid/graphics/Bitmap;

    .line 295
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageBmp:Landroid/graphics/Bitmap;

    const v3, -0x777778

    invoke-virtual {v2, v3}, Landroid/graphics/Bitmap;->eraseColor(I)V

    .line 296
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v3, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v3, v3, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageBmp:Landroid/graphics/Bitmap;

    const/4 v4, 0x0

    invoke-static {v3, v4}, Lcom/nemustech/tiffany/world/TFTextures;->createTextureInfo(Landroid/graphics/Bitmap;Landroid/graphics/Rect;)Lcom/nemustech/tiffany/world/TFTextureInfo;

    move-result-object v3

    iput-object v3, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageTextureInfo:Lcom/nemustech/tiffany/world/TFTextureInfo;

    .line 299
    :cond_0
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageTextureInfo:Lcom/nemustech/tiffany/world/TFTextureInfo;

    invoke-virtual {v2, v6}, Lcom/nemustech/tiffany/world/TFTextureInfo;->getLayer(I)Lcom/nemustech/tiffany/world/TFTextureInfo$TFTextureLayer;

    move-result-object v0

    .line 301
    .local v0, layer:Lcom/nemustech/tiffany/world/TFTextureInfo$TFTextureLayer;
    iput-boolean v6, v0, Lcom/nemustech/tiffany/world/TFTextureInfo$TFTextureLayer;->bTexturized:Z

    .line 302
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageBmp:Landroid/graphics/Bitmap;

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v2

    invoke-virtual {v0, v2}, Lcom/nemustech/tiffany/world/TFTextureInfo$TFTextureLayer;->setWidth(I)V

    .line 303
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageBmp:Landroid/graphics/Bitmap;

    invoke-virtual {v2}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v2

    invoke-virtual {v0, v2}, Lcom/nemustech/tiffany/world/TFTextureInfo$TFTextureLayer;->setHeight(I)V

    .line 304
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mDefaultDelayImageTextureInfo:Lcom/nemustech/tiffany/world/TFTextureInfo;

    const/16 v3, 0x2601

    iget-object v4, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    sget v4, Lcom/nemustech/tiffany/world/TFWorld;->mTextureMagicKey:I

    invoke-static {p1, v2, v3, v6, v4}, Lcom/nemustech/tiffany/world/TFTextures;->setTextureInfo(Ljavax/microedition/khronos/opengles/GL10;Lcom/nemustech/tiffany/world/TFTextureInfo;III)V

    .line 310
    .end local v0           #layer:Lcom/nemustech/tiffany/world/TFTextureInfo$TFTextureLayer;
    :cond_1
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mBackground:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    if-eqz v2, :cond_2

    .line 311
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mBackground:Lcom/nemustech/tiffany/world/TFWorld$TFBackground;

    invoke-virtual {v2, p1}, Lcom/nemustech/tiffany/world/TFWorld$TFBackground;->genTexture(Ljavax/microedition/khronos/opengles/GL10;)V

    .line 314
    :cond_2
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mFognizer:Ljava/lang/Runnable;

    if-eqz v2, :cond_3

    .line 315
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    iget-object v2, v2, Lcom/nemustech/tiffany/world/TFWorld;->mFognizer:Ljava/lang/Runnable;

    invoke-static {v2}, Lcom/nemustech/tiffany/world/TFWorld;->queueEvent(Ljava/lang/Runnable;)V

    .line 316
    :cond_3
    return-void

    .line 260
    :cond_4
    const-string v2, "TFRenderer"

    const-string v3, "Hardware query matrix is not supported. Using Tiffany engine\'s matrix."

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    goto/16 :goto_0
.end method

.method public onSurfaceDestroyed()V
    .locals 2

    .prologue
    .line 322
    const-string v0, "TFRenderer"

    const-string v1, "SurfaceDestroyed"

    invoke-static {v0, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 323
    invoke-virtual {p0}, Lcom/nemustech/tiffany/world/TFRenderer;->initDrawCount()V

    .line 324
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    const/4 v1, 0x1

    iput-boolean v1, v0, Lcom/nemustech/tiffany/world/TFWorld;->mPaused:Z

    .line 326
    return-void
.end method

.method remove(Lcom/nemustech/tiffany/world/TFHolder;Z)V
    .locals 3
    .parameter "holder"
    .parameter "destroy"

    .prologue
    .line 415
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 417
    :try_start_0
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFHolder;->isCloneObject()Z

    move-result v1

    if-nez v1, :cond_0

    if-eqz p2, :cond_0

    .line 418
    const/4 v1, 0x0

    const/4 v2, 0x0

    invoke-static {p1, v1, v2}, Lcom/nemustech/tiffany/world/TFRenderer;->removeHelper(Lcom/nemustech/tiffany/world/TFHolder;ZZ)V

    .line 421
    :cond_0
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFHolder;->getLayer()Lcom/nemustech/tiffany/world/TFWorld$Layer;

    move-result-object v1

    invoke-virtual {v1, p1}, Lcom/nemustech/tiffany/world/TFWorld$Layer;->remove(Ljava/lang/Object;)Z

    .line 422
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/nemustech/tiffany/world/TFHolder;->setLayer(Lcom/nemustech/tiffany/world/TFWorld$Layer;)V

    .line 423
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 424
    monitor-exit v0

    .line 425
    return-void

    .line 424
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method remove(Lcom/nemustech/tiffany/world/TFModel;Z)V
    .locals 2
    .parameter "model"
    .parameter "destroy"

    .prologue
    .line 392
    const-class v0, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v0

    .line 393
    :try_start_0
    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->getLayer()Lcom/nemustech/tiffany/world/TFWorld$Layer;

    move-result-object v1

    invoke-virtual {v1, p1}, Lcom/nemustech/tiffany/world/TFWorld$Layer;->remove(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_1

    .line 395
    if-eqz p2, :cond_0

    invoke-virtual {p1}, Lcom/nemustech/tiffany/world/TFModel;->deleteAllImageResource()V

    .line 396
    :cond_0
    const/4 v1, 0x0

    invoke-virtual {p1, v1}, Lcom/nemustech/tiffany/world/TFModel;->setLayer(Lcom/nemustech/tiffany/world/TFWorld$Layer;)V

    .line 397
    const/4 v1, 0x0

    iput-object v1, p1, Lcom/nemustech/tiffany/world/TFModel;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    .line 400
    :cond_1
    iget-object v1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mWorld:Lcom/nemustech/tiffany/world/TFWorld;

    invoke-static {}, Lcom/nemustech/tiffany/world/TFWorld;->requestRender()V

    .line 401
    monitor-exit v0

    .line 402
    return-void

    .line 401
    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method

.method remove(Lcom/nemustech/tiffany/world/TFObject;Z)V
    .locals 1
    .parameter "object"
    .parameter "destroy"

    .prologue
    .line 445
    instance-of v0, p1, Lcom/nemustech/tiffany/world/TFModel;

    if-eqz v0, :cond_1

    .line 446
    check-cast p1, Lcom/nemustech/tiffany/world/TFModel;

    .end local p1
    invoke-virtual {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFRenderer;->remove(Lcom/nemustech/tiffany/world/TFModel;Z)V

    .line 450
    :cond_0
    :goto_0
    return-void

    .line 447
    .restart local p1
    :cond_1
    instance-of v0, p1, Lcom/nemustech/tiffany/world/TFHolder;

    if-eqz v0, :cond_0

    .line 448
    check-cast p1, Lcom/nemustech/tiffany/world/TFHolder;

    .end local p1
    invoke-virtual {p0, p1, p2}, Lcom/nemustech/tiffany/world/TFRenderer;->remove(Lcom/nemustech/tiffany/world/TFHolder;Z)V

    goto :goto_0
.end method

.method setActiveLayer(Lcom/nemustech/tiffany/world/TFWorld$Layer;)Lcom/nemustech/tiffany/world/TFWorld$Layer;
    .locals 3
    .parameter "layer"

    .prologue
    .line 353
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 354
    :try_start_0
    iget-object v0, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

    .line 355
    .local v0, previousActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;
    iput-object p1, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;

    .line 356
    monitor-exit v1

    return-object v0

    .line 357
    .end local v0           #previousActiveLayer:Lcom/nemustech/tiffany/world/TFWorld$Layer;
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2
.end method

.method setFrontLayer(Lcom/nemustech/tiffany/world/TFWorld$Layer;)Z
    .locals 3
    .parameter "layer"

    .prologue
    .line 373
    const-class v1, Lcom/nemustech/tiffany/world/TFWorld;

    monitor-enter v1

    .line 374
    :try_start_0
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    invoke-virtual {v2, p1}, Ljava/util/LinkedList;->remove(Ljava/lang/Object;)Z

    move-result v0

    .line 376
    .local v0, result:Z
    if-eqz v0, :cond_0

    .line 377
    iget-object v2, p0, Lcom/nemustech/tiffany/world/TFRenderer;->mLayer:Ljava/util/LinkedList;

    invoke-virtual {v2, p1}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z

    .line 379
    :cond_0
    monitor-exit v1

    return v0

    .line 380
    .end local v0           #result:Z
    :catchall_0
    move-exception v2

    monitor-exit v1
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v2
.end method
